import Vue from 'vue'
import Vuex from 'vuex'
import mutations from './mutations'
import actions from './actions'


Vue.use(Vuex);

// 先写个假数据
const state = {
  user: {
    type : null,
    mobile : '',
    nickname : '',
    sex : null,  //0 = female, 1 = male, 2...
    school : '',
    address : '',
    description : '', //个性签名
    birthday : '', //xxxx-xx-xx形式
    picturePath : '', //头像, 填入上传返回的path
    fileName : '' //填入头像的文件名
  },
  coursesInfo: [
    // res = ARRAY of {
    //   className : STRING,
    //   id : STRING,
    //   description:  STRING
    // }
  ],
  articleList: [
    // res = [{"id":"73a2b49a-a8e0-44f8-bde9-f06597411f6c", "title":"关于的通知",
    //   "updatedAt":"2017-04-08T01:24:08.748Z", "top":false,"enforced":true,
    //   "userId":"fa6d471f-3893-40fc-b576-d8f084c087d2","replyNum":0}, ...]
  ]
}

export default new Vuex.Store({
  state,
  mutations,
  actions
})
